package app.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class Admin {

	private static final Log logger = LogFactory.getLog(Admin.class);

	@RequestMapping(value = { "/admin", "/admin/", "/admin/index" })
	public String index(Model model) {


		model.addAttribute("message", "I'm index!");

		return "index";
	}

	@RequestMapping(value = "/admin/userlist", method = RequestMethod.GET)
	public String loginGET(Model model) {


		model.addAttribute("message", "I'm login loginGET!");

		return "login";
	}

	@RequestMapping(value = "/admin/userlist", method = RequestMethod.POST)
	public String loginPOST(@RequestParam("username") String username, @RequestParam("password") String password,
			Model model) {


		model.addAttribute("message", "I'm login loginPOST!");

		return "login";
	}

}
